<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>线段 交接处宽度</title>
    <link rel="stylesheet" type="text/css" href="/css/YTSConfig.css">
    <link rel="stylesheet" type="text/css" href="/css/Style.css">
</head>
<body>
    <div class="body SuspensionFixationALLWindow">
        <canvas id="tutorial" class="canvas AbsHorizontalVerticalCenter"
            style="width: 300px; height: 150px;">
            <p>不支持类型内容, 这是一个 HTML Canvas 控件</p>
        </canvas>
    </div>

    <script type="text/javascript">
        var canvas = document.getElementById('tutorial');
        if (!canvas.getContext) {
            alert('不支持 canvas.getContext 意味: 不支持 canvas 属性');
        }
        var ctx = canvas.getContext('2d');

        var lineJoin = ['round', 'bevel', 'miter'];
        ctx.lineWidth = 10;
        for (var i = 0; i < lineJoin.length; i++) {
            ctx.miterLimit = 52*i;
            // ctx.lineJoin = lineJoin[i];
            ctx.beginPath();
            ctx.moveTo(-5, 5 + i*40);
            ctx.lineTo(35, 45 + i*40);
            ctx.lineTo(75, 5 + i*40);
            ctx.lineTo(115, 45 + i*40);
            ctx.lineTo(155, 5 + i*40);
            ctx.stroke();
        }
    </script>
</body>
</html>
